﻿CREATE TABLE [dbo].[Workflows] (
    [WorkflowID]   INT            IDENTITY (1, 1) NOT NULL,
    [WorkflowName] NVARCHAR (MAX) NULL,
    [SLA]          INT            DEFAULT ((0)) NOT NULL,
    [UnitID]       INT            NOT NULL,
    CONSTRAINT [PK_dbo.Workflows] PRIMARY KEY CLUSTERED ([WorkflowID] ASC),
    CONSTRAINT [FK_dbo.Workflows_dbo.Units_Unit_UnitID] FOREIGN KEY ([UnitID]) REFERENCES [dbo].[Units] ([UnitID])
);


GO
CREATE NONCLUSTERED INDEX [IX_UnitID]
    ON [dbo].[Workflows]([UnitID] ASC);

